package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Order entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_ORDER", schema = "HCD_DEV")
public class Order extends Entity implements java.io.Serializable {

	// Fields

	private Long orderId;
	private Member memberByMemberId;
	private Member memberByCheckerId;
	private Store store;
	private String orderCode;
	private String serialCode;
	private Long addressId;
	private String consignee;
	private String phone;
	private String address;
	private String postalCode;
	private Long deliveryId;
	private String delivery;
	private Long payId;
	private String pay;
	private Integer payMethodType;
	private String payMethod;
	private Byte promoteType;
	private Long promoteId;
	private String promoteName;
	private Double promoteBack;
	private String remark;
	private Integer status;
	private Long statusTime;
	private Byte prevStatus;
	private Float reckonCost;
	private Float realCost;
	private Integer integral;
	private Boolean isLocalSale;
	private Boolean isStockBack;
	private Boolean isMemberDel;
	private Boolean isStoreDel;
	private Long orderTime;
	private Set<OrderGoods> orderGoodses = new HashSet<OrderGoods>(0);

	// Constructors

	/** default constructor */
	public Order() {
	}

	/** minimal constructor */
	public Order(Store store, String orderCode, String consignee, String phone, String address,
			String delivery, String pay, Integer payMethodType, Integer status, Long statusTime,
			Float reckonCost, Float realCost, Integer integral, Boolean isLocalSale,
			Boolean isStockBack, Boolean isMemberDel, Boolean isStoreDel, Long orderTime) {
		this.store = store;
		this.orderCode = orderCode;
		this.consignee = consignee;
		this.phone = phone;
		this.address = address;
		this.delivery = delivery;
		this.pay = pay;
		this.payMethodType = payMethodType;
		this.status = status;
		this.statusTime = statusTime;
		this.reckonCost = reckonCost;
		this.realCost = realCost;
		this.integral = integral;
		this.isLocalSale = isLocalSale;
		this.isStockBack = isStockBack;
		this.isMemberDel = isMemberDel;
		this.isStoreDel = isStoreDel;
		this.orderTime = orderTime;
	}

	/** full constructor */
	public Order(Member memberByMemberId, Member memberByCheckerId, Store store, String orderCode,
			String serialCode, Long addressId, String consignee, String phone, String address,
			String postalCode, Long deliveryId, String delivery, Long payId, String pay,
			Integer payMethodType, String payMethod, Byte promoteType, Long promoteId,
			String promoteName, Double promoteBack, String remark, Integer status, Long statusTime,
			Byte prevStatus, Float reckonCost, Float realCost, Integer integral,
			Boolean isLocalSale, Boolean isStockBack, Boolean isMemberDel, Boolean isStoreDel,
			Long orderTime, Set<OrderGoods> orderGoodses) {
		this.memberByMemberId = memberByMemberId;
		this.memberByCheckerId = memberByCheckerId;
		this.store = store;
		this.orderCode = orderCode;
		this.serialCode = serialCode;
		this.addressId = addressId;
		this.consignee = consignee;
		this.phone = phone;
		this.address = address;
		this.postalCode = postalCode;
		this.deliveryId = deliveryId;
		this.delivery = delivery;
		this.payId = payId;
		this.pay = pay;
		this.payMethodType = payMethodType;
		this.payMethod = payMethod;
		this.promoteType = promoteType;
		this.promoteId = promoteId;
		this.promoteName = promoteName;
		this.promoteBack = promoteBack;
		this.remark = remark;
		this.status = status;
		this.statusTime = statusTime;
		this.prevStatus = prevStatus;
		this.reckonCost = reckonCost;
		this.realCost = realCost;
		this.integral = integral;
		this.isLocalSale = isLocalSale;
		this.isStockBack = isStockBack;
		this.isMemberDel = isMemberDel;
		this.isStoreDel = isStoreDel;
		this.orderTime = orderTime;
		this.orderGoodses = orderGoodses;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_ORDER")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "ORDER_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getOrderId() {
		return this.orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEMBER_ID")
	public Member getMemberByMemberId() {
		return this.memberByMemberId;
	}

	public void setMemberByMemberId(Member memberByMemberId) {
		this.memberByMemberId = memberByMemberId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHECKER_ID")
	public Member getMemberByCheckerId() {
		return this.memberByCheckerId;
	}

	public void setMemberByCheckerId(Member memberByCheckerId) {
		this.memberByCheckerId = memberByCheckerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "ORDER_CODE", nullable = false, length = 50)
	public String getOrderCode() {
		return this.orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}

	@Column(name = "SERIAL_CODE", length = 50)
	public String getSerialCode() {
		return this.serialCode;
	}

	public void setSerialCode(String serialCode) {
		this.serialCode = serialCode;
	}

	@Column(name = "ADDRESS_ID", precision = 15, scale = 0)
	public Long getAddressId() {
		return this.addressId;
	}

	public void setAddressId(Long addressId) {
		this.addressId = addressId;
	}

	@Column(name = "CONSIGNEE", nullable = false, length = 60)
	public String getConsignee() {
		return this.consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	@Column(name = "PHONE", nullable = false, length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "ADDRESS", nullable = false, length = 250)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "POSTAL_CODE", length = 20)
	public String getPostalCode() {
		return this.postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	@Column(name = "DELIVERY_ID", precision = 15, scale = 0)
	public Long getDeliveryId() {
		return this.deliveryId;
	}

	public void setDeliveryId(Long deliveryId) {
		this.deliveryId = deliveryId;
	}

	@Column(name = "DELIVERY", nullable = false, length = 100)
	public String getDelivery() {
		return this.delivery;
	}

	public void setDelivery(String delivery) {
		this.delivery = delivery;
	}

	@Column(name = "PAY_ID", precision = 15, scale = 0)
	public Long getPayId() {
		return this.payId;
	}

	public void setPayId(Long payId) {
		this.payId = payId;
	}

	@Column(name = "PAY", nullable = false, length = 100)
	public String getPay() {
		return this.pay;
	}

	public void setPay(String pay) {
		this.pay = pay;
	}

	@Column(name = "PAY_METHOD_TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getPayMethodType() {
		return this.payMethodType;
	}

	public void setPayMethodType(Integer payMethodType) {
		this.payMethodType = payMethodType;
	}

	@Column(name = "PAY_METHOD", length = 100)
	public String getPayMethod() {
		return this.payMethod;
	}

	public void setPayMethod(String payMethod) {
		this.payMethod = payMethod;
	}

	@Column(name = "PROMOTE_TYPE", precision = 2, scale = 0)
	public Byte getPromoteType() {
		return this.promoteType;
	}

	public void setPromoteType(Byte promoteType) {
		this.promoteType = promoteType;
	}

	@Column(name = "PROMOTE_ID", precision = 15, scale = 0)
	public Long getPromoteId() {
		return this.promoteId;
	}

	public void setPromoteId(Long promoteId) {
		this.promoteId = promoteId;
	}

	@Column(name = "PROMOTE_NAME", length = 250)
	public String getPromoteName() {
		return this.promoteName;
	}

	public void setPromoteName(String promoteName) {
		this.promoteName = promoteName;
	}

	@Column(name = "PROMOTE_BACK", precision = 8)
	public Double getPromoteBack() {
		return this.promoteBack;
	}

	public void setPromoteBack(Double promoteBack) {
		this.promoteBack = promoteBack;
	}

	@Column(name = "REMARK", length = 400)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "STATUS", nullable = false, precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "STATUS_TIME", nullable = false, precision = 15, scale = 0)
	public Long getStatusTime() {
		return this.statusTime;
	}

	public void setStatusTime(Long statusTime) {
		this.statusTime = statusTime;
	}

	@Column(name = "PREV_STATUS", precision = 2, scale = 0)
	public Byte getPrevStatus() {
		return this.prevStatus;
	}

	public void setPrevStatus(Byte prevStatus) {
		this.prevStatus = prevStatus;
	}

	@Column(name = "RECKON_COST", nullable = false, precision = 8)
	public Float getReckonCost() {
		return this.reckonCost;
	}

	public void setReckonCost(Float reckonCost) {
		this.reckonCost = reckonCost;
	}

	@Column(name = "REAL_COST", nullable = false, precision = 8)
	public Float getRealCost() {
		return this.realCost;
	}

	public void setRealCost(Float realCost) {
		this.realCost = realCost;
	}

	@Column(name = "INTEGRAL", nullable = false, precision = 8, scale = 0)
	public Integer getIntegral() {
		return this.integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	@Column(name = "IS_LOCAL_SALE", nullable = false, precision = 1, scale = 0)
	public Boolean getIsLocalSale() {
		return this.isLocalSale;
	}

	public void setIsLocalSale(Boolean isLocalSale) {
		this.isLocalSale = isLocalSale;
	}

	@Column(name = "IS_STOCK_BACK", nullable = false, precision = 1, scale = 0)
	public Boolean getIsStockBack() {
		return this.isStockBack;
	}

	public void setIsStockBack(Boolean isStockBack) {
		this.isStockBack = isStockBack;
	}

	@Column(name = "IS_MEMBER_DEL", nullable = false, precision = 1, scale = 0)
	public Boolean getIsMemberDel() {
		return this.isMemberDel;
	}

	public void setIsMemberDel(Boolean isMemberDel) {
		this.isMemberDel = isMemberDel;
	}

	@Column(name = "IS_STORE_DEL", nullable = false, precision = 1, scale = 0)
	public Boolean getIsStoreDel() {
		return this.isStoreDel;
	}

	public void setIsStoreDel(Boolean isStoreDel) {
		this.isStoreDel = isStoreDel;
	}

	@Column(name = "ORDER_TIME", nullable = false, precision = 15, scale = 0)
	public Long getOrderTime() {
		return this.orderTime;
	}

	public void setOrderTime(Long orderTime) {
		this.orderTime = orderTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "order")
	public Set<OrderGoods> getOrderGoodses() {
		return this.orderGoodses;
	}

	public void setOrderGoodses(Set<OrderGoods> orderGoodses) {
		this.orderGoodses = orderGoodses;
	}

}